<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<title><?php echo $title; ?></title>
	<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/stylez.css" />
	<link type="text/css" href="<?php echo base_url(); ?>assets/css/jquery.jscrollpane.css" rel="stylesheet" media="all" />
	
	<script src="<?php echo base_url(); ?>assets/js/jquery-1.7.1.min.js" type="text/javascript"></script>
	<script src="<?php echo base_url(); ?>assets/js/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>

	<script src="<?php echo base_url(); ?>assets/js/jquery-css-transform.js" type="text/javascript"></script>
	<script src="<?php echo base_url(); ?>assets/js/sun-rays.js" type="text/javascript"></script>
	<script src="<?php echo base_url(); ?>assets/js/jquery-animate-css-rotate-scale.js" type="text/javascript"></script>
	<script src="<?php echo base_url(); ?>assets/js/jheader-area.js" type="text/javascript"></script>
	<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/jquery.mousewheel.js"></script>
	<!-- the jScrollPane script -->
	<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/jquery.jscrollpane.min.js"></script>
	<script type = "text/javascript">

		$(document).ready(function(){
			var pane = $('.scroll-pane');
			pane.jScrollPane(
				{
					showArrows: true
				}
			);
			var api = pane.data('jsp');

			$('#but-scroll-to').bind(
				'click',
				function()
				{
					// Note, there is also scrollToX and scrollToY methods if you only
					// want to scroll in one dimension
					api.scrollTo(parseInt($('#toX').val()), parseInt($('#toY').val()));
					return false;
				}
			);

			$('#but-scroll-by').bind(
				'click',
				function()
				{
					// Note, there is also scrollByX and scrollByY methods if you only
					// want to scroll in one dimension
					api.scrollBy(parseInt($('#byX').val()), parseInt($('#byY').val()));
					return false;
				}
			);
			$('#add-testimonial-form').submit(function(){

				var testi_message = $('#testi-message').attr("value");
				var captcha = $('#captcha').attr("value");
				var error = true;

				if(testi_message == ""){
					error = false;
					$('.error').html("Please fill up your testimonial.").fadeIn().delay(1000).fadeOut();
				}
				else{
					if(captcha == ""){
					error = false;
					$('.error').html("Please fill up captcha.").fadeIn().delay(1000).fadeOut();
					}
					else{
						var $captcha = $('#captcha').val();
						var path = $('#hidden-captcha').attr("value");
						//alert("ok");
							$.ajax({
							url:path,
							type:'post',
							data:'captcha='+$captcha,
							success:function(data) {
								if(data=="same"){
									//alert("ok");
									error = true;

									var form_data = $('#add-testimonial-form').serialize();
									var path1 = $('#hidden').attr("value");

									$.ajax({
										url: path1,
										data: form_data,
										type : 'POST',

										 success: function(data){
											$('.error').html("Sakto.").fadeIn().delay(1000).fadeOut(1000, function(){
												$('#testi-wrap').prepend('<li><div id = "testi-info"><p>'+$('#testi-message').val()+'</p></div><div id = "testi-user"><p class = "testi-uname"></p></div></li>', function(){
													$('#testi-message').val('');
												});
											});

										},
										 complete: function(){
											$('#captcha').val('');
										},

									});

								}else{
									error = false;
									$('.error').html("Incorrect captcha.").fadeIn().delay(1000).fadeOut();
								}
							}
						});

					}
				}
				return false;
			});
		});
</script>

</head>
<?php
$records = myuser_helper::getUserData();
?>
<body>
	<div id = "bg-container">
		<div id = "sun-rays" class = "sun-rays">
		</div>
	</div>
	<div id = "wrapper">
		<header>
			<div id = "flash-area">
				<embed src="<?php echo base_url(); ?>assets/images/hearttree-profile.swf" width="212" height="180" type="application/x-shockwave-flash" wmode="transparent" menu="false" />
			</div>
			<div id = "menu-area">
				<ul id = "user-menu">
					<?php if(isset($_SESSION['is_logged_in']) && $_SESSION['is_logged_in'] && isset($_SESSION['email'])){?>
						<a href = "<?php echo base_url();?>" title = "Home"><li class = "user-home"></li></a>
						<a href = "<?php echo base_url();?>profile"><li class = "user-profile"></li></a>
					<?php }else{ ?>
						<a href = "<?php echo base_url();?>" title = "Home"><li class = "user-home" style="margin:24px 0 0 134px;"></li></a>
					<?php }//end if?>
					<a href = "<?php echo base_url();?>testimonial"><li class = "user-testi"></li></a>
					<a href = "#"><li class = "user-faq"></li></a>
					<a href = "<?php echo base_url();?>contact/"><li class = "user-contct"></li></a>
				</ul>
			</div>
			<?php if (isset($_SESSION['is_logged_in']) && $_SESSION['is_logged_in']) : ?>
				<?php $current_img_path = $_SERVER['DOCUMENT_ROOT'].'/mlme2/assets/images'.$records->picture ; ?>
				<div id = "account-area">
					<div id = "account-wrap">
						<div id = "accountz">
							<div class = "profile-pic">
							<?php 
							$toResize = (file_exists($current_img_path) && !empty($records->picture)) ? base_url().'assets/images/'.$records->picture : base_url().'assets/images/default.png';
							$src = image_helper::resize_photo($toResize, '30', '27'); 
							?>
							<img src="<?php echo $src?>" alt=""/>		
						</div>
							<h2><?php echo $records->firstname; ?></h2>

							<span id = "arrow-down"><img src = "<?php echo base_url(); ?>assets/images/arrow-down.png" /></a></span>
							<div id = "account-list">
								<ul>
									<li><a href = "<?php echo base_url();?>profile">My Account</a></li>
									<li><a href = "<?php echo base_url();?>profile/edit">Edit Settings</a></li>
									<!--<li><a href = "">Help</a></li>-->
									<li><a href = "<?php echo base_url(); ?>profile/logout">Logout</a></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			<?php else: ?>

			<?php endif; ?>
			<div class="clear"></div>

		</header>

		<div id = "wrap">